<template>
    <div>    
      <p style="font-size:40px;font-weight:bold" >
        <span >&lt;</span>
      </p>
      <h1>欢迎您的登录</h1>
      <p>
          用户名: <input type="text" v-model="username" />
      </p>
      <p>
          密码: <input type="password" v-model="userpass" />
      </p>
      <p>
          <input type="button" value="登录" @click="loginCheck">
      </p>
    </div>
  </template>
  
  <script>
import { Toast } from 'vant';
  
  export default {
      name:"Reg",
      data(){
          return {
              username:"王义鑫",
              userpass:"123666"
          }
      },
      created(){
        console.log("Login.created");
      },
      methods:{
        loginCheck(){
            this.$http({
              url:"http://localhost:3000/vips",
              parasm:{
                username:this.username,
                userpass:this.userpass
              }
            }).then((result) => {
              Toast("登录成功！");
              sessionStorage.setItem("username",this.username);
              // 跳转回去
              let path = this.$route.query.path;
              this.$router.push(path);

            }).catch((err) => {
              
            });
        }
        
      }
  
  }
  </script>
  
  <style>
  
  </style>